package com.dd.cloud.open.exception;

import com.dd.cloud.open.enums.ResponseEnum;

/**
 * @author zk
 */
public class ApiException extends RuntimeException {
    /**
     * 状态码
     */
    private Integer code;
    /**
     * 主体信息
     */
    private Object body;

    public ApiException(Integer code, Object body) {
        this.code = code;
        this.body = body;
    }

    public ApiException(ResponseEnum responseEnum) {
        this.code = responseEnum.getCode();
        this.body = responseEnum.getBody();
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public Object getBody() {
        return body;
    }

    public void setBody(Object body) {
        this.body = body;
    }
}
